Public Class frmOpenItem
    Dim index As Integer = 1

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub frmOpenItem_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        
    End Sub

    Private Sub frmOpenItem_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        PublicFunction.NewFormLoad(Me)
    End Sub

    Private Sub Keyboardcontrol1_UserKeyPressed(ByVal sender As System.Object, ByVal e As VINAPOS.KeyboardClassLibrarySmall.KeyboardEventArgs) Handles Keyboardcontrol1.UserKeyPressed
        Select Case index
            Case 1
                txtItemName.Focus()
            Case 2
                txtPrice.Focus()
        End Select
        SendKeys.Send(e.KeyboardKeyPressed)
    End Sub

    Private Sub txtItemName_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtItemName.Enter
        index = 1
    End Sub

    Private Sub txtPrice_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPrice.Enter
        index = 2
    End Sub

    Private Sub txtPrice_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPrice.ButtonClick
        PublicVariable.frmCalculator.Top = txtPrice.Top + txtPrice.Height
        PublicVariable.frmCalculator.Left = txtPrice.Left + txtPrice.Width
        If PublicVariable.frmCalculator.ShowDialog = Windows.Forms.DialogResult.OK Then
            txtPrice.Text = String.Format(PublicVariable.NumberFormatString, PublicVariable.frmCalculator.txtResult.Text)
        End If
    End Sub
End Class